
<script src="js/upload/jquery.form.js" type="text/javascript"></script>

<script>

	$(function(){			   
		$("[type=button]").button();
	})

$(document).ready(function(){
    $('#btnEnvia').click(function(){
								  
        $('#formUploadAudio').ajaxForm({
            success: function(data) {			
                if(data.sucesso == true){
                    //$.jAlert(data.msg, '', function(result) {});
					$html = $("#conteudo_infografico").html();
					$("#conteudo_infografico").html(data.msg+" "+$html);
					$( ".draggable" ).draggable({ containment: "#conteudo_infografico", scroll: true });
					$('#audio_info').dialog('close');
					$('#audio').val('');
					
					audiojs.createAll();
                }
                else{			
					$.jAlert(data.msg, '', function(result) {});
                }                
            },
            error : function(){				
				$.jAlert('Erro ao enviar requisição!!!', '', function(result) {});
            },
            dataType: 'json',
            url: "actions/uploadAudioInfoAction.php?id="+$('#info_id').val(),
            resetForm: true
        }).submit();
    })
})

</script>

<div id='audio_info' title='Inserir Audio' style='text-align:center;'>
<form name="formUploadAudio" id="formUploadAudio" method="post"  enctype="multipart/form-data">
    <label><b>Selecione o arquivo:</b> <br/><br/>
    <input type="file" name="audio" id="audio" size="25" /></label>
    <input type="hidden" value="<?php echo $_GET['idinfo']; ?>" id="info_id" name="info_id" />
    <input type="button" id="btnEnvia" value="Enviar" />
    <input type="button" id="btnFechar" name="btnFechar" value="Fechar" onClick="$('#audio_info').dialog('close');" />
</form>
</div>